﻿<UserControl x:Class="Views.ViewEncoursRetrait"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:VMtxgar="clr-namespace:OMANE.Modules.TauxGarantis.ViewModels"
             xmlns:SysData="clr-namespace:System.Data;assembly=System.Data"
             DataContext="{Binding Source={x:Static VMtxgar:Locator.ViewModelCmdEncoursRetraitStatic}}"
             mc:Ignorable="d" 
             d:DesignHeight="400" 
             d:DesignWidth="500" >

    <!--xmlns:igDP="http://infragistics.com/DataPresenter"-->

    <UserControl.Resources>
        <DataTemplate x:Key="ListeTrTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=NomTable}"></TextBlock>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <GroupBox Grid.Column="0" 
                  Grid.Row="0"
                  Style="{StaticResource OMANE_GpeBox}"
                  Header="Définition des tranches d'âge" 
                  Margin="20,20,10,10">
            <Grid>
            	<Grid.ColumnDefinitions>
            		<ColumnDefinition Width="*"/>
            		<ColumnDefinition Width="Auto"/>
            	</Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <ComboBox x:Name="CbxTrAge"
                          Height="24"
                          Grid.Row="0"
                          ItemsSource="{Binding ListeTablesTranchesAge}"
                          SelectedItem="{Binding SelectedTrancheAge}"
                          Margin="5,8" 
                          Style="{StaticResource OMANE_cbx}"
                          ItemTemplate="{StaticResource ListeTrTemplate}"/>
                <DataGrid   ItemsSource="{Binding Path=TableTranchesAge}"
							Style="{StaticResource DataGridStyle1}"
                            ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle1}"
                            ColumnWidth="*"
                            Grid.Row="1"
                            Margin="5" 
                            Name="DataGridTrAge" 
							CellStyle="{DynamicResource DataGridCellStyle1}"	
							IsReadOnly="{Binding tbleTrAgeAllowUserModifications}" 
							SelectionMode="Single" 
							ItemsPanel="{DynamicResource ItemsPanelTemplate1}" 
							RowHeaderStyle="{DynamicResource DataGridRowHeaderStyle1}"
							Grid.ColumnSpan="2"
                            ToolTipService.ShowDuration="1200000">
                    <DataGrid.ToolTip>
                            <ToolTip>
                            <TextBlock Text="{Binding ToolTipTableTranchesAge}"></TextBlock>
                            </ToolTip>
                    </DataGrid.ToolTip>
                </DataGrid>
                <Button Content="Save" Grid.Column="1" VerticalAlignment="Center" Margin="5,0" Visibility="Collapsed">
                    <Button.ToolTip>
                        <ToolTip>
                            <TextBlock>Enregistrer la table courante</TextBlock>
                        </ToolTip>
                    </Button.ToolTip>
                </Button>
            </Grid>
        </GroupBox>
        <GroupBox Margin="10,20,20,10" 
                  Grid.Row="0" 
                  Grid.Column="1" 
                  Style="{StaticResource OMANE_GpeBox}" 
                  Header="Définition des capitaux empruntés" IsEnabled="False">
            <Grid>
            	<Grid.ColumnDefinitions>
            		<ColumnDefinition Width="*"/>
            		<ColumnDefinition Width="Auto"/>
            	</Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <ComboBox x:Name="CbxTrCapi"
                          Grid.Row="0"
                          Height="24"
                          Margin="5"
                          ItemsSource="{Binding ListeTablesTranchesCapi}"
                          SelectedItem="{Binding SelectedTrancheCapi}"
                          Style="{StaticResource OMANE_cbx}"
                          ItemTemplate="{StaticResource ListeTrTemplate}" />
                <DataGrid xml:lang="fr-FR" Margin="5"
                          Grid.Row="1"
						  Grid.ColumnSpan="2"
                          RowHeaderStyle="{DynamicResource DataGridRowHeaderStyle1}"
                          ItemsSource="{Binding Path=TableTranchesCapi}"
						  Style="{StaticResource DataGridStyle1}" 
                          Name="XamDataGridTrCapitaux"
                          CellStyle="{DynamicResource DataGridCellStyle1}"
                          ToolTipService.ShowDuration="1200000"
                          ColumnWidth="*"
                          ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle1}">
                    <DataGrid.ToolTip>
                        <ToolTip StaysOpen="True">
                            <TextBlock Text="{Binding ToolTipTableTranchesCapi}"></TextBlock>
                        </ToolTip>
                    </DataGrid.ToolTip>
                </DataGrid>
                <Button Content="Save" Grid.Column="1" VerticalAlignment="Center" Margin="5,0" Visibility="Collapsed">
                    <Button.ToolTip>
                        <ToolTip>
                            <TextBlock>Enregistrer la table courante</TextBlock>
                        </ToolTip>
                    </Button.ToolTip>
                </Button>
            </Grid>
        </GroupBox>
        <GroupBox Margin="20,10,20,20" 
                  Grid.Row="1" 
                  Grid.Column="0" 
                  Grid.ColumnSpan="2" 
                  Style="{StaticResource OMANE_GpeBox}" 
                  Header="Filtres sur la base en entrée"/>
    </Grid>
</UserControl>
